<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象相关知识</title>
</head>

<body>
    <script>
        let a = 'name'
        let obj = {}//希望空对象变为{name:'tom'}
        obj[a] = 'tom'//加方括号读取对象并赋值
    </script>
</body>

</html>